Install Apache httpd
2014/08/25 |
Install httpd to configure Web server.
|
|
[1] | Install httpd. |
[root@www ~]#
yum -y install httpd # remove welcome page [root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf # remove default error page [root@www ~]# rm -f /var/www/error/noindex.html |
[2] | Configure httpd. Replace the Server name to your own one. |
[root@www ~]#
vi /etc/httpd/conf/httpd.conf # line 44: change ServerTokens Prod
# line 76: change to ON KeepAlive On
# line 262: Admin's address ServerAdmin root@srv.world
# line 338: change AllowOverride All
# line 276: change to your server's name ServerName www.srv.world:80
# line 402: add file name that it can access only with directory's name DirectoryIndex index.html index.htm
# line 536: change ServerSignature Off
/etc/rc.d/init.d/httpd start Starting httpd: [ OK ] [root@www ~]# chkconfig httpd on |
[3] | If IPTables is running, allow HTTP port. HTTP uses 80/TCP. For "-I INPUT 5" section below, Replace it to your own environment. |
[root@www ~]# iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT |
[4] | Create a HTML test page and access to it with a web browser on Client to make sure it works normally. |
[root@www ~]#
vi /var/www/html/index.html <html> <body> <div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;"> Test Page </div> </body> </html> |